package com.crealth.db;

import com.crealth.manager.MybatisManager;
import com.crealth.model.SendBackEarnestModel;

public class SendBackEarnestDb {

	public static SendBackEarnestModel selectEarnestByProductID(int productID) {
		SendBackEarnestModel earnest = MybatisManager.earnestMapper.selectEarnestByProductID(productID);
		return earnest;
	}
	
	public static Integer insertSendBackEarnest(SendBackEarnestModel earnest) {
		Integer res = MybatisManager.earnestMapper.insertSendBackEarnest(earnest);
		MybatisManager.commit();
		
		return res;
	}
	
	public static Integer updateEarnestByProductID(SendBackEarnestModel earnest) {
		Integer res = MybatisManager.earnestMapper.updateEarnestByProductID(earnest);
		MybatisManager.commit();
		
		return res;
	}
	
	public static Integer updateEarnestStatusByProductID(int productID, int setStatus) {
		Integer res = MybatisManager.earnestMapper.updateEarnestStatusByProductID(productID, setStatus);
		MybatisManager.commit();
		
		return res;
	}
	
	public static Integer updateEarnestCheckNameByID(int id, String checkerName) {
		Integer res = MybatisManager.earnestMapper.updateEarnestCheckNameByID(id, checkerName);
		MybatisManager.commit();
		
		return res;
	}
	
	
}
